#!/bin/sh
#sed -i 's/\r$//' urfile
path=$(pwd)
imageName="solo"
container=$(docker ps -a|grep $imageName |awk '{print $1}')
if [ -n "$container" ]; then
    docker stop $imageName
    docker rm $imageName
fi
image=$(docker images|grep $imageName |awk '{print $1}')
if [ -n "$image" ]; then
    docker rmi $image:1.0
fi
cd $path
docker build -t "imageName":1.0 .
docker run --name $imageName --net=host --restart=always -d $imageName:1.0
